package com.example.oversea_home_spring.serviceImpl;

import com.example.oversea_home_spring.bean.*;
import com.example.oversea_home_spring.mapper.OwnerMapper;
import com.example.oversea_home_spring.service.OwnerService;
import com.example.oversea_home_spring.uitl.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class OwnerServiceImpl implements OwnerService {

    @Autowired
    private OwnerMapper ownerMapper;

    //申请仓库 add

    @Override
    public int addHouse(Warehouse warehouse){
        return ownerMapper.addHouse(warehouse);
    }

    @Override
    public List<Warehouse> getHouses(String userId){
        return ownerMapper.getHouses(userId);
    }
    @Override
    public int updateHouse(Warehouse warehouse){
        return ownerMapper.updateHouse(warehouse);
    }

    @Override
    public int deleteHouse(String id){
        return ownerMapper.deleteHouse(id);
    }

    //查询员工
    @Override
    public List<User> selectAllMyWorker(String userId){
        return ownerMapper.selectAllMyWorker(userId);
    }

    //修改员工信息
    @Override
    public int updateWorkerInfo(Management management){
        return ownerMapper.updateWorkerInfo(management);
    }
    //查询租客
    @Override
    public List<User> selectAllMyTrader(String userId){
        return ownerMapper.selectAllMyTrader(userId);
    }
    //查询租客的仓库请求
    @Override
    public List<Rent> selectAllMyHouseOrder(String userId){
        return ownerMapper.selectAllMyHouseOrder(userId);
    }
    @Override
    public int updateOneRent(Rent rent){
        return ownerMapper.updateOneRent(rent);
    }

}
